let mySet = new Set()

mySet.add(1)
mySet.add('some text')

const has = mySet.has(1)

mySet.delete('some text')

mySet.size

for (let item of mySet) {
  console.log(item)
}
for (let item of mySet.keys()) {
  console.log(item)
}
for (let item of mySet.values()) {
  console.log(item)
}
for (let item of mySet.entries()) {
  console.log(item.keys, item.value)
}

// set arr互相转换
const myArr = Array.from(mySet)

const mySet2 = new Set([1, 2, 3, 4])

// 交集
const intersection = new Set([...mySet].filter((item) => mySet2.has(item)))
